export function timeFormat(time, fmStr) { // 时间格式化
	const weekCN = '一二三四五六日';
	const weekEN = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'];
	let year = time.getFullYear(); // 年
	let month = time.getMonth() + 1; // 月
	let day = time.getDate(); // 天
	let hours = time.getHours(); // 时
	let minutes = time.getMinutes(); // 分
	let seconds = time.getSeconds(); // 秒
	let milliSeconds = time.getMilliseconds(); // 毫秒
	let week = time.getDay(); // 周

	month = month >= 10 ? month : ('0' + month);
	day = day >= 10 ? day : ('0' + day);
	hours = hours >= 10 ? hours : ('0' + hours);
	minutes = minutes >= 10 ? minutes : ('0' + minutes);
	seconds = seconds >= 10 ? seconds : ('0' + seconds);

	if (fmStr.indexOf('yyyy') !== -1) {
		fmStr = fmStr.replace('yyyy', year);
	} else {
		fmStr = fmStr.replace('yy', (year + '').slice(2));
	}
	fmStr = fmStr.replace('mm', month);
	fmStr = fmStr.replace('dd', day);
	fmStr = fmStr.replace('hh', hours);
	fmStr = fmStr.replace('MM', minutes);
	fmStr = fmStr.replace('ss', seconds);
	fmStr = fmStr.replace('SSS', milliSeconds);
	fmStr = fmStr.replace('W', weekCN[week - 1]); // 英文
	fmStr = fmStr.replace('ww', weekEN[week - 1]); // 中文
	fmStr = fmStr.replace('w', week); // 阿拉伯数字

	return fmStr;
};
